package com.itheima.restkeeper.face;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.restkeeper.DishFace;
import com.itheima.restkeeper.exception.ProjectException;
import com.itheima.restkeeper.req.DishVo;
import com.itheima.restkeeper.service.IDishFlavorService;
import com.itheima.restkeeper.service.IDishService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.annotation.Method;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @ClassName DishFaceImpl.java
 * @Description 菜品接口实现
 */
@Slf4j
@DubboService(version = "${dubbo.application.version}",timeout = 5000,
    methods ={
        @Method(name = "findDishVoPage",retries = 2),
        @Method(name = "createDish",retries = 0),
        @Method(name = "updateDish",retries = 0),
        @Method(name = "deleteDish",retries = 0)
    })
public class DishFaceImpl implements DishFace {

    @Autowired
    IDishService dishService;

    @Autowired
    IDishFlavorService dishFlavorService;

    @Override
    public Page<DishVo> findDishVoPage(DishVo dishVo, int pageNum, int pageSize) {
        //查询Page<Dish>分页对象
        //转换Page<Dish>为Page<DishVo>
        //转换List<Dish>为List<DishVo>
        //为每个菜品指定拥有的口味
        //返回结果
        return null;
    }

    @Override
    public DishVo createDish(DishVo dishVo) {
        //创建菜品
        //指定可有信息
        return null;
    }

    @Override
    public Boolean updateDish(DishVo dishVo) throws ProjectException {
        return null;
    }

    @Override
    public Boolean deleteDish(String[] checkedIds) {
        return null;
    }

    @Override
    public DishVo findDishByDishId(Long dishId) {
       return null;
    }

}
